package top.zhmq.goodsconsumer.Configuration;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import top.zhmq.goodsconsumer.filter.SysInterceptor;

/**
 *
 *
 * @author Glory
 * @classname SessionConfiguration
 * @create 2021-06-06 19:56
 */

@Configuration
//将拦截器添加到SpringBoot配置中
public class SessionConfiguration extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new SysInterceptor()).addPathPatterns("/goods/cart");
    }
}